package com.alex.boot;

import com.alex.boot.config.PublisherEvent;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import tk.mybatis.spring.annotation.MapperScan;

@SpringBootApplication(scanBasePackages = {"com.alex.*"})
@MapperScan(basePackages = {"com.alex.boot.dao.*."})
@EnableTransactionManagement
public class BootApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(BootApplication.class, args);
        PublisherEvent publisher = context.getBean(PublisherEvent.class);
        publisher.publish("Hello, World!", "Alex.shu", "I Love U");
    }
}
